From: Jonas Dreßler Date: Wed, 25 Apr 2018 23:36:41 +0000 (+0200) Subject: altTab: Only calculate iconSize once X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~530^2^2~231 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c8f3db31b896fea895c04b1745bb9cafa3ef2d6d;p=gnome-shell.git altTab: Only calculate iconSize once Right now, _setIconSize() calculates the icon size everytime the preferred height of AppSwitcher is calculated, which happens quite often. Reduce the perfomance impact by only calculating the icon size once. This has the added benefit of preventing unexpected changes to the icon sizes while the switcher is open. Part-of: --- diff --git a/js/ui/altTab.js b/js/ui/altTab.js index e7886e4f1..78450ac78 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -765,7 +765,9 @@ class AppSwitcher extends SwitcherPopup.SwitcherList { } vfunc_get_preferred_height(forWidth) { - this._setIconSize(); + if (!this._iconSize) + this._setIconSize(); + return super.vfunc_get_preferred_height(forWidth); }